Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace fips-mode-setup #349

Merged
merged 5 commits into from
Feb 24, 2025
Merged

Conversation

duzda
Copy link
Contributor

@duzda duzda commented Feb 17, 2025

RHEL10 doesn't support fips-mode-setup, therefore this call has been replaced with simple reading of a proc file. The tests have been edited accordingly, inconsistent has been removed and instead replaced by a test supplying an arbitrary value, that should never occur.

Fixes: #350

@duzda duzda force-pushed the replace-fips-mode-setup branch from 8611c42 to 3d6b7e7 Compare February 17, 2025 14:33
if not os.path.exists(paths.PROC_FIPS_ENABLED):
fips = "missing {}".format(paths.PROC_FIPS_ENABLED)
logger.debug("Can't find %s, skipping" %
paths.PROC_FIPS_ENABLED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit torn on this related to other distributions, whether enforcing that the file exist would break them.
When I originally wrote this I didn't want to hold it against a user that they didn't have a tool installed. But the file in /proc should be created by the kernel so if that's missing it points to a larger issue.
I think we should set rval to WARNING in this case. This file is created by the kernel so if FIPS is disabled in the KERNEL that seems odd. A user can suppress the warning if indeed they have this use-case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make the assumption, that this file exists, otherwise, the user is using a custom kernel and is probably not thinking about FIPS at all. Nevertheless, the return value is a warning now.

RHEL10 doesn't support fips-mode-setup, therefore this call
has been replaced with simple reading of a proc file.
The tests have been edited accordingly, inconsistent has been removed
and instead replaced by a test supplying an arbitrary value, that
should never occur.

Fixes: freeipa#350
Signed-off-by: David Hanina <dhanina@redhat.com>
Also renamed  test_fips_no_fips_enabled to test_fips_no_fips_available
as this name is more fitting, meaning the kernel is missing fips.

Signed-off-by: David Hanina <dhanina@redhat.com>
The missing PROC_FIPS_ENABLED should be considered a bug
in the base package, therefore no need to check here.

Signed-off-by: David Hanina <dhanina@redhat.com>
@duzda duzda force-pushed the replace-fips-mode-setup branch from 70b4ec8 to ad2620d Compare February 24, 2025 09:17
@rcritten
Copy link
Collaborator

thanks, looks good.

@rcritten rcritten merged commit f42dc7b into freeipa:master Feb 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove fips-mode-setup
2 participants